package cz.muni.fi.hauntedhouses.entity;

import cz.muni.fi.hauntedhouses.enums.Fear;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 *
 * @author Martin Vala, 359917
 */
@Entity
public class Skill implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    
    @Column(columnDefinition="VARCHAR(50)", nullable=false)
    private String name;
    
    /**
     * Power of the skill.
     * Determines how much human would be scared if this skill is used.
     */
    @Column(nullable=false)
    private Integer power;
    
     //Shows which fear this skill causes to human.
    @Enumerated(EnumType.STRING)
    @Column(nullable=false)
    private Fear causesFear;
    
    private String description;

    
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getPower() {
        return power;
    }

    public void setPower(Integer power) {
        this.power = power;
    }

    public Fear getCausesFear() {
        return causesFear;
    }

    public void setCausesFear(Fear causesFear) {
        this.causesFear = causesFear;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof Skill)) {
            return false;
        }
        Skill other = (Skill) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Skill[ id=" + id + " name=" + name + " power=" + power + " causesFear=" + causesFear + " description=" + description + " ]";
    }
    
}
